#include <apue.h>

int 
main()
{
	int		n, int1, int2;
	char 	line[MAXLINE];

	if (setvbuf(stdin, NULL, _IOLBF, 0) != 0)
		printf("setvbuf error!\n");

	// if (setvbuf(stdout, NULL, _IOLBF, 0) != 0)
	// 	printf("setvbuf error!\n");

	// while ((n = read(STDIN_FILENO, line, MAXLINE)) > 0)
	while (fgets(line, MAXLINE, stdin) != NULL) {
		// line[n] = 0;

		if (sscanf(line, "%d%d", &int1, &int2)  == 2) {
			// sprintf(line, "%d\n", int1 + int2);
			// n = strlen(line);

			// if (write(STDOUT_FILENO, line, n) != n)
			// 	printf("write error\n");
			if (printf("%d\n", int2 + int1) == EOF)
				printf("printf error");
		} else {
			// if (write(STDOUT_FILENO, "invalid args \n", 13) != 13) 
			// 	printf("write error\n");
			if (printf("invalied args\n") == EOF)
				printf("printf error");
		}
	}
	return 0;
}